public class Test {
    public static void main(String[] args) {
        MyStack stack=new MyStack();
//        stack.pop(); //报错

        stack.push(1);
        stack.push(2);
        stack.push(3);
        stack.display();

        System.out.println(stack.pop());
        stack.display();

        stack.push(3);
        stack.push(4);
        stack.display();

        System.out.println(stack.peek());

        if(stack.isEmpty()){
            System.out.println("栈空");
        }
        else{
            System.out.println(stack.size());
        }
    }
}
